
package com.zsrt.day0523.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;

public class MySql {

	public static void main(String[] args) throws Exception{
		
		Class.forName("com.mysql.jdbc.Driver");
		
		 String url="jdbc:mysql://localhost:3306/my";
		//system为登陆oracle数据库的用户名     
	     String user="root";    
	    //manager为用户名system的密码     
	     String password="123456";    
		Connection conn = DriverManager.getConnection(url, user, password);
		
		if(conn==null){    
            System.out.println("与sql数据库连接失败！");    
        }else{    
            System.out.println("与sql数据库连接成功！");    
        } 
	}
}
